<?php

// $Id: login_form_view.class.php 1571 2009-01-13 13:08:33Z ogrebg $

require_once(TANGRA_MAIN_DIR.'/form/form_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/password/form_field_password_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/hidden/form_field_hidden_view.class.php');

class Login_Form_View extends Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_username = $form->get_field('username');
		$f_username_view = new Form_Field_Text_View($form->get_name().'_'.$f_username->get_name(), $f_username);
		$this->add_field_view('username', $f_username_view);

		$f_password = $form->get_field('password');
		$f_password_view = new Form_Field_Password_View($form->get_name().'_'.$f_password->get_name(), $f_password);
		$this->add_field_view('password', $f_password_view);

		$f_remember = $form->get_field('remember');
		$f_remember_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_remember->get_name(), $f_remember);
		$this->add_field_view('remember', $f_remember_view);

		$f_return_to = $form->get_field('return_to');
		$f_return_to_view = new Form_Field_Hidden_View($form->get_name().'_'.$f_return_to->get_name(), $f_return_to);
		$this->add_field_view('return_to', $f_return_to_view);

		$f_return_to_params = $form->get_field('return_to_params');
		$f_return_to_params_view = new Form_Field_Hidden_View($form->get_name().'_'.$f_return_to_params->get_name(), $f_return_to_params);
		$this->add_field_view('return_to_params', $f_return_to_params_view);
	}
}
